#include <iostream>
using namespace std;
#include <vector>

void mySort(vector<int>& v, bool (*cmp)(int,int))
{
	for(int i = 0; i < v.size() - 1; i++){
		for(int j = 0; j < v.size() - i - 1; j++){
			if(cmp(v[j + 1], v[j])){
				v[j] = v[j] ^ v[j + 1];
				v[j + 1] = v[j] ^ v[j + 1];
				v[j] = v[j] ^ v[j + 1];
			}
		}
	}
}

bool cmp(int x, int y)
{
	return x < y;
}

int main(int argc, char **argv)
{
	vector<int> v= {1,2,3,5,6,8,0,22,34};
	mySort(v, cmp);

	for(auto i : v){
		cout << i << " ";
	}
	cout << endl;


	return 0;
}
